Skip to content

Conversation

@ElementUser
Copy link

@ElementUser ElementUser commented May 23, 2025

Description of Changes

Migrated Tomcat Vault to be compatible with JDK18+ by removing deprecated classes (SecurityManager, AccessController - Tomcat Vault will not work properly on JDK18+ without doing so), and incidentally makes Tomcat Vault be compatible with Tomcat 10 (since Tomcat 10 is likely to run on JDK18+).

SecurityManager was safe to remove, as the feature that was used the most was the checkPermission() function. See this Snyk article for more details: https://snyk.io/blog/securitymanager-removed-java/

Motivation

The motivation was quite simple - at my workplace, we are using Tomcat Vault for Tomcat 9 & are migrating some applications to Tomcat 10 & using JDK21 as our current LTS JDK. We wish to continue using Tomcat Vault with Tomcat 10 and JDK21, and that prompted me to work on making Tomcat Vault compatible with them.

Other minor changes

  • Also refactored Unit Tests to not use the deprecated classes, and avoids using the System property to test
  • Added Maven profiles to specify the Tomcat major version to build for (default major version: Tomcat 9), and removed some unnecessary properties from the pom.xml file as a result
  • Updated INSTALL.md with the appropriate details for building with a different Maven profile for different Tomcat versions (either major version or exact version)
  • Removed other minor deprecation warnings (e.g. new Integer() is replaced with Integer.valueOf()
  • Specified the version for maven-surefire-plugin via a property in the pom.xml file, and also upgraded the version to a recent one (3.5.3)

Testing

I tested this locally & on an actual Windows server at my workplace, everything works as intended with Tomcat Vault for the encrypted passwords & referencing them from Tomcat's context.xml files)

The unit test suite also passed when running them.

…ated classes (SecurityManager, AccessController - Tomcat Vault will not work properly on JDK18+ without doing so), and incidentally makes Tomcat Vault be compatible with Tomcat 10 (since Tomcat 10 is likely to run on JDK18+)

- Also refactored Unit Tests to not use the deprecated classes, and avoids using the System property to test
- Added Maven profiles to specify the Tomcat major version to build for (default major version: Tomcat 9)
- Updated `INSTALL.md` with the appropriate details for building with a different Maven profile for different Tomcat versions (either major version or exact version)
- Removed other minor deprecation warnings (e.g. `new Integer() is replaced with `Integer.valueOf()`
@ElementUser ElementUser changed the title Migrated Tomcat Vault to be compatible with JDK18+ by removing deprecated classes (SecurityManager, AccessController - Tomcat Vault will not work properly on JDK18+ without doing so), and incidentally makes Tomcat Vault be compatible with Tomcat 10 (since Tomcat 10 is likely to run on JDK18+) Migrated Tomcat Vault to be compatible with JDK18+ by removing deprecated classes (SecurityManager, AccessController) May 23, 2025
@ElementUser ElementUser changed the title Migrated Tomcat Vault to be compatible with JDK18+ by removing deprecated classes (SecurityManager, AccessController) Migrated Tomcat Vault to be compatible with JDK18+ and Tomcat 10 by removing deprecated classes (SecurityManager, AccessController) May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants